from django.db import models

# Create your models here.
class device(models.Model):
    id=models.AutoField(primary_key=True)
    serial_no=models.CharField(max_length=50,null=False,unique=True)
    name=models.CharField(max_length=50,null=False)
    type=models.CharField(max_length=50,null=False)
    location=models.CharField(max_length=200)
    status=models.IntegerField(choices=[(0,'正常'),(1,'维修'),(2,'报废')])
    purchase_data=models.DateTimeField(auto_now_add=True)
    last_check=models.DateTimeField()